home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / pcpil / pidoc8.txt < prev    next >
Text File  |  1994-02-28  |  36KB  |  787 lines

  1. ASCII CHARACTERS 128 TO 255
  2.  
  3. INPUT CHARACTERS IN PILOT 
  4.  
  5. The ACCEPT statement allows codes 32 to 255 to be entered as part of student 
  6. replies.  Characters in this range are echoed to the display so that the 
  7. student sees what has been typed.  
  8.  
  9. Characters from 0 to 31 are reserved for special purposes; specifically, 
  10. character 13 is the RETURN character which signals the end of the student 
  11. reply.  Character 8 is a backspace character which may be used to back up and 
  12. correct typing errors. And character 3 (ctrl-C) cancels a PILOT program 
  13. immediately. Other characters in the range 0 to 31 are completely ignored by 
  14. the ACCEPT statement (unless it is an ACCEPT-SINGLE, AS: in which case all 
  15. codes other than ctrl-C may be entered).  
  16.  
  17. BASIC appendix G, pages G2 and G3, show the codes generated for most of the 
  18. normal printable character keys on the keyboard. The chart below shows the 
  19. codes generated for the various special keys on the keyboard.  
  20.  
  21. DEFAULT KEYBOARD CODES ON AN ACCEPT STATEMENT 
  22.  
  23. 128-131     alt- 9 0 - =
  24. 132         ctrl-pg up
  25. 143         shift-tab
  26. 144-153     alt- Q W E R T Y U I O P
  27. 158-166     alt- A S D F G H J K L
  28. 172-178     alt- Z X C V B N M
  29. 187-196     f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
  30. 199         home
  31. 200         cursor up
  32. 201         pg up
  33. 203         cursor left
  34. 205         cursor right
  35. 207         end
  36. 208         cursor down
  37. 209         pg dn
  38. 210         ins
  39. 211         del
  40. 212-221     shift- f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
  41. 222-231     ctrl-  f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
  42. 232-241     alt- f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
  43. 242         ctrl-prtsc
  44. 243         ctrl-cursor left
  45. 244         ctrl-cursor right
  46. 245         ctrl-end
  47. 246         ctrl-pg dn
  48. 247         ctrl-home
  49. 248-255     alt- 1 2 3 4 5 6 7 8
  50.  
  51. HOW TO CHANGE KEYBOARD VALUES
  52.  
  53. The  NX: statement allows the program to  change the  code  generated by any 
  54. key from  the  value shown  in the above table (or in BASIC  appendix G)  to  
  55. any other value from 0 to 255.  In  this manner the student can be informed 
  56. regarding  an alternate use of the keys when responding.  Thus the following 
  57. statements would make sense.  
  58.  
  59.        NX:153,227
  60.        T: Dear student,
  61.        :  If you wish to reply with the Greek letter
  62.        :  PI in any of your answers hold down the
  63.        :  ALT key while pushing the P key.
  64.        
  65. After the above NX: statement, any time the student typed ALT-P, character 
  66. 227 would be entered into the answer buffer and (assuming screen mode 0-3) 
  67. the letter PI would appear on the  screen. The ability to re-define the 
  68. keyboard keys allows the student to answer  with any  characters the program 
  69. writer has chosen. The AX:  op code can be used to make the keys temporarily 
  70. act like their normal defaults when it is necessary to be able to use the 
  71. keyboard in two ways depending on the context.  
  72.  
  73. 192 @      224 `
  74. 193 A      225 a
  75. 194 B      226 b  
  76. 195 C      227 c 
  77. 196 D      228 d  
  78. 197 E      229 e
  79. 198 F      230 f
  80. 199 G      231 g
  81. 200 H      232 h
  82. 201 I      233 i
  83. 202 J      234 j
  84. 203 K      235 k
  85. 204 L      236 l
  86. 205 M      237 m
  87. 206 N      238 n
  88. 207 O      239 o
  89. 208 P      240 p
  90. 209 Q      241 q
  91. 210 R      242 r
  92. 211 S      243 s
  93. 212 T      244 t
  94. 213 U      245 u
  95. 214 V      246 v
  96. 215 W      247 w
  97. 216 X      248 x
  98. 217 Y      249 y
  99. 218 Z      250 z
  100. 219 [      251 {
  101. 220 \      252 | 
  102. 221 ]      253 }
  103. 222 ^      254 ~ 
  104. 223 _      255 Alt-8
  105.  
  106.  
  107.  
  108. Appendix C. STUDENT RECORDS 
  109.  
  110. The File In, File Out and Keep statements can be used in many combinations to 
  111. perform custom student record keeping. The unique needs of any program can be 
  112. accommodated by programming the desired record keeping functions into the 
  113. program. There are however, several typical record keeping functions that may 
  114. occur in substantially the same form over and over. Since these needs arise 
  115. repeatedly PILOT provides a set of simple macros which can be used to include 
  116. student record keeping in a program with minimal effort.  
  117.  
  118. To use these macros, the author would include them at the appropriate points 
  119. in the program via the F7 key of the EZ editor.  
  120.  
  121. RESTART MACROS
  122.  
  123. The term "restart" implies that the student may leave the program prior to 
  124. completion, and may resume at the same point in the program at a later time. 
  125. These macros are used to build a student restart file which contains the 
  126. student's id number, name, and the point at which the student should resume 
  127. upon return to the program. These macros also provide for the preservation of 
  128. data about the student's progress.  The size and nature of that data is up to 
  129. the programmer.  
  130.  
  131. To use these two macros it is necessary to include the "RESTART.PIM" macro in 
  132. the initialization section of the program. Then the "CHECKPT.PIM" macro is 
  133. included at every point within the program where the student might be 
  134. permitted to resume upon return. If the program is a series of distinct 
  135. problems, the start of each problem might be considered to be a check point.  
  136.  
  137.  
  138. PROGRAM ORGANIZATION 
  139.  
  140. The organization of the program should be as follows: 
  141.  
  142.        <your program initialization code>
  143.  
  144.        RESTART macro expanded here
  145.        . . .
  146.  
  147.        CHECKPT macro expanded here
  148.        <first section of the program>
  149.  
  150.        CHECKPT macro expanded here
  151.        <second section of the program>
  152.  
  153.        CHECKPT macro expanded here
  154.        <third section of the program>
  155.        . . .
  156.  
  157.        CHECKPT macro expanded here
  158.        <message informing user that program is completed>
  159.  
  160.  
  161. THE  RESTART.PIM  MACRO
  162.  
  163. Prior to the RESTART macro, use EZ to write your dimension statements, set 
  164. the screen modes, etc, and perform any initial code which would need to be 
  165. done for any student whether returning to the program or starting for the 
  166. first time.  
  167.  
  168. Then, still in EZ, position after the above statements, push F7 and enter the 
  169. name RESTART.PIM.  The RESTART macro prompts for two parameters. The first is 
  170. the name of the file to be used for keeping student data. You can enter any 
  171. valid file name or just push the ENTER key to use the default file name 
  172. "RESTART".  
  173.  
  174. The second prompt requests the size of the user data area to be set aside in 
  175. each student record. This area is used to store any data your program might 
  176. need to keep about a student. The restart macro records this data at each 
  177. check point and restores it upon each program restart. The programmer can 
  178. choose to retain from 0 to 500 bytes of student data. In the simplest case 
  179. just push ENTER to indicate that no optional student data area is needed.  
  180.  
  181. Once the two parameters are entered the RESTART macro expands about 3 screens 
  182. of PILOT code. When the program is executed, the code asks for the student 
  183. ID, and name. It maintains the restart file and handles the branching of the 
  184. student to the appropriate restart point upon return.  
  185.  
  186. THE  CHECKPT.PIM  MACRO
  187.  
  188. Next, determine which points within the program are check points. A student 
  189. always resumes at the last check point passed prior to leaving the program. 
  190. At the start of each section which is to be a check point, use the F7 key and 
  191. enter the name CHECKPT.PIM.  This macro expands the code necessary to save 
  192. the student restart data at that point so that restart can function.  
  193.  
  194. It is completely up to the programmer to determine how many check points are 
  195. placed in the program, and where they are placed. Each time the student 
  196. reaches a check point the location of the check point and the current value 
  197. of the user data variable UDAT$ is recorded in the restart file under that 
  198. student's id. When a student starts the program, the student's id number is 
  199. used to look up the student record. The value of the user data variable UDAT$ 
  200. is restored from the last data saved in the student record, then a Jump is 
  201. performed to the last check point location saved for that student. 
  202.  
  203.  
  204. SAVING USER DATA
  205.  
  206. The program can use the restart facility to save data about the student from 
  207. one run to the next. To do so, when entering the RESTART macro, indicate the 
  208. number of bytes to be reserved in each student record for optional data. The 
  209. number may be from 1 to 500. The actual amount is up to the programmer. This 
  210. data is saved and restored by the restart facility but its actual use in the 
  211. program is determined only by how the programmer uses the data.  
  212.  
  213. The restart macro creates a string variable called UDAT$ which has a maximum 
  214. length equal to the size specified for optional user data. Each call to the 
  215. CHECKPT macro causes the current contents of UDAT$ to be recorded in the 
  216. student's record on disk. When a student returns to the program the last 
  217. value saved for UDAT$ is restored to the variable UDAT$ prior to jumping to 
  218. the instruction just after the CHECKPT.  
  219.  
  220. The program can place any data within the string UDAT$ prior to each call to 
  221. CHECKPT. And, if necessary the data can be moved from UDAT$ to other 
  222. variables just after each call to CHECKPT. 
  223.  
  224. THE RESTART FILE
  225.  
  226. The student record file is in ascii text format and contains one line per 
  227. student. Each line contains a 10 byte field for student id number, a 30 byte 
  228. field for name, a 10 byte field for the last check point label, from 1 to 500 
  229. bytes of optional user data, a return character and a line feed character. To 
  230. list the file on the display enter the command: 
  231.  
  232.      TYPE  RESTART
  233.  
  234. To print the student record file enter the command:
  235.  
  236.      COPY  RESTART  PRN: 
  237.  
  238.  
  239. Appendix D. GRAPHIC IMAGE PROCESSING
  240.  
  241. The PILOT GX: command can be used to display a graphic image stored in a disk 
  242. file. The GX: command accepts an image in BSAVE format, so called because it 
  243. is the format that is produced by the BASIC language BSAVE command. There are 
  244. some limitations to this format and the GX: command. First, only the original 
  245. CGA modes, 0 through 6 are supported, not the higher resolution modes of the 
  246. EGA. Second, the pictures are stored as uncompressed bit mapped images, so 
  247. each picture occupies 16K on disk regardless of the complexity of the 
  248. picture. Third, the GX: command always displays the entire picture, and does 
  249. not use any special effects in the display.  
  250.  
  251. PILOT includes a set of utilities to address these limitations. These 
  252. utilities permit the author to: 
  253.  
  254.      Import a picture created by a graphics programs for 
  255.      display from within a PILOT lesson.  
  256.  
  257.      Store the picture on disk in a compressed format which
  258.      reduces the storage requirements.
  259.  
  260.      Display a picture in any graphics mode, including the
  261.      EGA high resolution modes.
  262.  
  263.      Display an entire picture, or any portion of the picture.
  264.      When a portion of a picture is displayed, it may be
  265.      positioned anywhere on the display.
  266.  
  267.      Display the picture using a variety of special effects,
  268.      such as horizontal and vertical wipes or fades.
  269.  
  270. The user must distinguish between pictures which will be displayed in low 
  271. resolution modes (4, 5 and 6) and those which will be displayed in EGA modes 
  272. (13, 14 and 16). For the low resolution modes, pictures are 320 by 200 
  273. pixels, 4 colors.  PILOT programs expect these pictures to be in PIQ format.  
  274. A picture to be used in a low resolution mode can be created with the GIE 
  275. program which is included with PILOT, via a PILOT program which saves the 
  276. picture via the GSX: statement, or by capturing the image from another 
  277. program with the BSAVER utility. These image files can be compressed and 
  278. stored in PIQ format via the PIQCMPRS utility. PIQCMPRS can also be used to 
  279. convert a .PCX file created via PC/Paintbrush to PIQ format.  Then the images 
  280. may be displayed in a PILOT program via the PIQI, PIQS and PIQF macros.  
  281.  
  282. For EGA high resolution modes, pictures can be up to 640 by 350, 16 colors. 
  283. PILOT programs expect these pictures to be in PCX format as produced by 
  284. PC/Paintbrush (trademark of Zsoft Corporation). These pictures can be created 
  285. with PC/Paintbrush (installed for EGA mode), or by using the FRIEZE utility 
  286. program (part of Paintbrush) to capture a screen image from another program. 
  287. Since this format is already in a compressed form, PILOT does not require any 
  288. further processing of the picture, it can be called up from a PILOT program 
  289. in exactly the form created by Paintbrush. These images can be displayed in a 
  290. PILOT program via the EGAPIQI and EGAPIQ macros.  
  291.      
  292. The various utilities for managing graphic images of both 
  293. types are described below.  
  294.  
  295. LOW RESOLUTION PICTURES
  296.  
  297. Low resolution pictures can be used on an IBM Color Graphics Adapter (CGA) or 
  298. Extended Graphics Adapter (EGA). These pictures are displayed in PILOT screen 
  299. modes 4, 5 or 6. To use a picture of this form in your PILOT program follow 
  300. these steps: 
  301.  
  302.      Create the picture with GIE, or via a PILOT program GSX:
  303.      command, or with PC/Paintbrush (installed for 320 by 200
  304.      mode), or via the BSAVER capture utility.
  305.  
  306.      Run the PIQCMPRS utility to convert and compress the
  307.      picture to PIQ format.
  308.  
  309.      Use the EZ editor to expand the PIQI, PIQF and/or PIQS
  310.      macros into your PILOT program.
  311.  
  312. The BSAVER Utility
  313.  
  314. The file BSAVER.EXE contains the BSAVER utility. It can be used to capture a 
  315. graphic image from any program which operates in 320 by 200 screen mode (CGA 
  316. graphics mode). To use BSAVER you first load it into RAM via the command 
  317.  
  318.      BSAVER
  319.  
  320. This does not cause anything visible to happen. Rather, BSAVER loads into 
  321. memory and remains there until called up later.  
  322.  
  323. Having loaded BSAVER, execute the graphics program with which you will create 
  324. the picture. Run it normally until the picture you wish to capture is 
  325. displayed.  
  326.  
  327. Then push the PRTSC key (while holding down SHIFT). BSAVER wakes up and 
  328. displays a prompt on the top of the screen. The prompt shows the file name 
  329. BSAVER will use to save the current screen display. You can continue by 
  330. pressing Enter, or you can type another file name to use. BSAVER increments 
  331. the file name so that it is convenient to use it to capture a series of 
  332. pictures without entering a new file name for each.  
  333.  
  334. The files created by BSAVER are in BSAVE format. These files can be processed 
  335. by GIE, by the PILOT GX: command, or by the PIQCMPRS utility.  
  336.  
  337. If the image captured by BSAVER is a text mode image, it can be used directly 
  338. in a PILOT program by setting the appropriate screen mode, and referring to 
  339. the file via the GX: command.  Though the same method would work for a 
  340. graphics mode image, it is reccommended that the image be converted first to 
  341. PIQ format.  This saves space and enhances the possible display options.  
  342.  
  343. The PIQCMPRS Utility
  344.  
  345. This utility is used to convert a BSAVE or PCX format picture to PIQ format. 
  346. It is valid for CGA graphics modes only, 320 by 200, 4 color. To use it enter 
  347. the command: 
  348.  
  349.      PI PIQCMPRS
  350.  
  351. Then follow the prompt to enter the name of the input file. If the input file 
  352. name ends in ".PCX", it is assumed to be in PC/Paintbrush format. Otherwise 
  353. it is assumed to be in BSAVE format. The graphic image is then saved in a 
  354. file with a suffix of ".PIQ". 
  355.  
  356. The PIQI, PIQS, PIQF and GETFILE Macros
  357.  
  358. These macros can be included in your PILOT program to display pictures which 
  359. have been prepared via the PIQCMPRS utility. The EZ editor is used to expand 
  360. these macro calls in your program. To expand a macro, move the cursor to the 
  361. desired position in the program file and push the F7 function key. Then enter 
  362. the macro name (complete with the .PIM suffix). Then respond to each prompt 
  363. as necessary. The use of each macro is detailed below. 
  364.  
  365. PIQI.PIM
  366.  
  367. The PIQI macro must be expanded toward the start of the program. It reads in 
  368. the binary file PIQSHOW.BIN and prepares for display of PIQ images. PIQI need 
  369. only be executed once per program. The file PIQSHOW.BIN must be present with 
  370. the program when it is executed. The macro files need only be present when 
  371. the program is written. 
  372.  
  373. PIQF.PIM
  374.  
  375. Once the PIQI macro has been executed once, any number of PIQF macros can be 
  376. used. The PIQF macro causes the display of a picture, stored in a PIQ file. 
  377. To use PIQF push the F7 function key in EZ, and enter the name PIQF.PIM. The 
  378. following parameters must be entered in response to the PIQF prompts: 
  379.  
  380.      Filename
  381.  
  382. Here enter the name of the image file. Though the file name is of the form 
  383. nnn.PIQ, do not enter the ".PIQ" suffix. Just enter the first part of the 
  384. file name.  
  385.  
  386.      Wipe (C, D, E, F, H, I, L, R, U, V)
  387.  
  388. This selects the manner in which the image is painted onto the screen. One of 
  389. the following letters must be entered : 
  390.  
  391.      C is from upper left corner. 
  392.      D is down, from top to bottom. 
  393.      E is explode from center out. 
  394.      F is a fade in. 
  395.      H is a horizontal spilt towards both edges. 
  396.      I  is implode from edges inward. 
  397.      L is from right to left. 
  398.      R is from left to right. 
  399.      U is up from bottom to top. 
  400.      V is vertical spilt from center to top and bottom. 
  401.  
  402.      Option: Xor Mode or Border Color
  403.  
  404. This prompt permits input of additional wipe information. It may be used to 
  405. specify the XOR option on any wipe except the fade. The xor option causes the 
  406. image to be blended with the existing display rather than to overlay it. A 
  407. second possibility for this prompt is to specify a number 0, 1, 2 or 3 for 
  408. the down or right wipes. The number indicates that a border is to precede the 
  409. down or rightward wipe. The number indicates the color of the border. If 
  410. neither the xor or border option is desired, this reply may be left blank.  
  411.  
  412.      Change Window Parameters
  413.  
  414. This prompt requests a y (for yes) or n (for no) response. In fact, any 
  415. response except y is taken as a no. The window parameters determine whether 
  416. the entire picture, or just part of the picture is to be displayed. A no 
  417. response indicates that the last window parameters executed on any PIQF or 
  418. PIQS macro are to be used again. The default setting when the program begins 
  419. causes the entire image to be displayed. A yes response causes four 
  420. additional prompts for the window boundaries: leftmost column (0-39), 
  421. rightmost column (0-39), top row (0-24) and bottom row (0-24). 
  422.  
  423.      Change Position Parameters
  424.  
  425. This prompt requests a y or n response. The position parameters can be used 
  426. when a partial image is displayed to place the partial image at any screen 
  427. location. A no response indicates that the last position parameters executed 
  428. on any PIQF or PIQS macro are to be used again. A yes response causes two 
  429. additional prompts for the new position: leftmost column (0-39) and top row 
  430. (0-24). 
  431.  
  432.      Delay Time (0-254)
  433.  
  434. This parameter controls the speed at which the special effect is performed. 0 
  435. indicates maximum speed, which with a D wipe is the fastest display possible. 
  436. As the delay time is increased, the speed is decreased.  
  437.  
  438. PIQS.PIM 
  439.  
  440. PIQS, like PIQF, is used to display a PIQ image. PIQF is used to read the 
  441. image from a file, then display it. PIQS is used to display an image which 
  442. has previously been read into a string variable. PIQS is useful when one 
  443. image is to be displayed repeatedly since it can avoid the overhead of re-
  444. reading the image from disk. It can also be used when several images are to 
  445. be displayed in rapid succession since all the images could be pre-read from 
  446. disk prior to the display of the first image. To use PIQS the program must 
  447. first have loaded the image file into a string variable via the GETFILE 
  448. macro. The prompts for PIQS are similar to those for PIQF except that rather 
  449. than entering the name of a file containing the image, the author must enter 
  450. the name of a string variable containing the image. 
  451.  
  452. GETFILE.PIM
  453.  
  454. The GETFILE macro can be used to create a string variable and read the 
  455. contents of a disk file into the string variable. It can be used to read in a 
  456. PIQ image, a sprite table, a binary subroutine, or other data. Its use in 
  457. conjunction with PIQ images is to pre-load a picture prior to using the PIQS 
  458. macro. 
  459.  
  460. The PIQ Binary Files
  461.  
  462. There are several binary files associated with PIQ image processing. Each is 
  463. of the form "PIQnnn.BIN". The only file which needs to be distributed with 
  464. the final PILOT program is PIQSHOW.BIN. The other binary files, as well as 
  465. the PIQ macro files need be present only when writing the program. 
  466.  
  467.  
  468. HIGH RESOLUTION PICTURES
  469.  
  470. High resolution pictures can be used only on an IBM Extended Graphics Adapter 
  471. (EGA), not on a Color Graphics Adapter (CGA). This facility can be used to 
  472. display pictures in PILOT screen modes 13, 14 and 16. To display a picture it 
  473. must be created via PC/Paintbrush using the corresponding screen mode. To use 
  474. a picture of this form in your PILOT program follow these steps: 
  475.  
  476.      Use PC/Paintbrush (installed for an EGA color mode) to
  477.      draw a picture. Save it in the normal manner. Or, use the
  478.      FRIEZE utility to capture an image from another program
  479.      in an EGA mode.
  480.  
  481.      Use the EZ editor to expand the EGAPIQI and EGAPIQ
  482.      macros into your PILOT program.
  483.  
  484. The EGAPIQI and EGAPIQ Macros
  485.  
  486. These macros can be included in your PILOT program to display pictures which 
  487. are in PCX format for EGA screen modes. The EZ editor is used to expand these 
  488. macro calls in your program. To expand a macro, move the cursor to the 
  489. desired position in the program file and push the F7 function key.  Then 
  490. enter the macro name (complete with the .PIM suffix).  Then respond to each 
  491. prompt as necessary.  
  492.  
  493. EGAPIQI.PIM
  494.  
  495. The EGAPIQI macro must be expanded toward the start of the program. It reads 
  496. in the binary file EGAPIQ.BIN and prepares for display of EGAPIQ images. 
  497. EGAPIQI need only be executed once per program. The file EGAPIQ.BIN must be 
  498. present with the program when it is executed. The macro files need only be 
  499. present when the program is written.  
  500.  
  501. EGAPIQ.PIM
  502.  
  503. The EGAPIQ macro may be used at any point in a program to display an EGA mode 
  504. picture. EGAPIQI must have been executed prior to EGAPIQ. To use EGAPIQ push 
  505. the F7 function key in EZ, and enter the name EGAPIQ.PIM. The following 
  506. parameters must be entered in response to the EGAPIQ prompts: 
  507.  
  508.      Filename
  509.  
  510. Here enter the name of the image file. Though the file name is of the form 
  511. nnn.PCX, do not enter the ".PCX" suffix. Just enter the first part of the 
  512. file name.  
  513.  
  514.      Wipe (D, F, L, R, U)
  515.  
  516. This selects the manner in which the image is painted onto the screen. One of 
  517. the following letters must be entered : 
  518.  
  519.      D is down, from top to bottom. 
  520.      F is a fade in. 
  521.      L is from right to left. 
  522.      R is from left to right. 
  523.      U is up from bottom to top. 
  524.  
  525.      Change Window Parameters
  526.  
  527. This prompt requires a y (for yes) or n (for no) response. In fact, any 
  528. response except y is taken as a no. The window parameters determine whether 
  529. the entire picture, or just part of the picture is to be displayed. A no 
  530. response indicates that the last window parameters executed on any EGAPIQ 
  531. macro are to be used again. The default setting when the program begins 
  532. causes the entire image to be displayed. A yes response causes four 
  533. additional prompts for the window boundaries: leftmost column (0-79), 
  534. rightmost column (0-79), top row (0-24) and bottom row (0-24). 
  535.  
  536.      Change Position Parameters
  537.  
  538. This prompt requires a y or n response. The position parameters can be used 
  539. when a partial image is displayed to place the partial image at any screen 
  540. location. A no response indicates that the last position parameters executed 
  541. on any EGAPIQ macro are to be used again. A yes response causes two 
  542. additional prompts for the new position: leftmost column (0-79) and top row 
  543. (0-24). 
  544.  
  545.      Delay Time (0-254)
  546.  
  547. This parameter controls the speed at which the special effect is performed. 0 
  548. indicates maximum speed, which with a D wipe is the fastest display possible. 
  549. As the delay time is increased, the speed is decreased.  
  550.  
  551.  
  552. Appendix E. LARGE COMPUTER SIMULATION
  553.  
  554. With PILOT, a simulation program can be created to provide effective operator 
  555. practice and training on the operation of a large scale computer system 
  556. operator's console. Such a simulation can be used as in inexpensive 
  557. substitute for the actual mainframe system for training purposes.  
  558.  
  559. Program example SAMPLE12.PIL is an example, derived from an actual full scale 
  560. simulator, which shows how this type of program might be developed with 
  561. PILOT. The goal of a simulator is to provide the user with a simulated copy 
  562. of the target computer system that allows for practical hands-on training in 
  563. a controlled environment. Though this example simulates a mainframe computer 
  564. console, similar technics could be used to simulate other systems. Advantages 
  565. of simulation include the ability to train operators and users before a 
  566. machine is installed, or to train new personel without tying up the actual 
  567. system.  
  568.  
  569. After a simulator is built, much of the same code might be used in a 
  570. companion tutorial program which, together with the simulator would make up a 
  571. complete training package.  
  572.  
  573. One approach for simulation of hardware systems is to build a complete 
  574. simulator first, then build various tutorial modules to allow for task skills 
  575. to be practiced be entering the simulator at different points.   The entry 
  576. modules would thus set up the environment of the simulator for each new task 
  577. to be learned.  After that task is practiced the student could return to the 
  578. tutorial for more instruction.  
  579.  
  580. Building the Simulator 
  581.  
  582. Most mainframe systems accept command sequences that an operator uses to 
  583. configure, start, stop, initialize control programs, and control the hardware 
  584. of the machine from a console.  Each screen of control information is called 
  585. a 'frame'. When any particular frame is displayed, there are certain keyboard 
  586. actions that operator might perform. Some actions move to another frame, 
  587. others might invoke commands unique to this frame, and yet others migh invoke 
  588. actions that are available from many different contexts.  
  589.  
  590. A convenient organization of the simulator program is to write  a separate 
  591. PILOT program module for each frame to be displayed and it's associated 
  592. control code.  Each file would also contain the necessary code to accept 
  593. keyboard input and perform the appropriate actions such as link to other 
  594. frames.  
  595.  
  596. An alternate approach is to build each frame as a separate file without the 
  597. control code.  Thus, you would have a set of files that contain only the text 
  598. to be displayed and the control code in another file.  
  599.  
  600. The second approach may be more efficient in the use of space because of the 
  601. reduction of duplicate routines.  Yet, if space is not a concern, you will 
  602. find it much easier to use the first approach where debugging and controlling 
  603. your program become less of a task.  
  604.  
  605. In either approach, a careful study and understanding of the machine to be 
  606. simulated is required.  For each frame, you should also be able to simulate 
  607. incorrect actions as well as correct actions.  Make note of the real 
  608. machine's messages and displayed actions for every possible operator command.  
  609. An action taken on one frame may effect the information displayed on another 
  610. frame.  The frame text that can be changed or effected by student commands 
  611. will have to be represent by variables called frame variables.  
  612.  
  613. Frame variables will have to be set to an initial value in your entry module.  
  614. This gives you the ability to set the initial status or condition of the 
  615. machine to be simulated.  It also allows you to break apart specific tasks 
  616. you would like to have the student accomplish.  
  617.  
  618. Development Tasks  
  619.  
  620. The following sequence of tasks may be helpful in building your machine 
  621. simulator: 
  622.  
  623. Study the operation of the target machine.  Make note of incorrect actions as 
  624. well as correct actions.  
  625.  
  626. Determine the machine frames to be simulated.  Create a separate text file 
  627. (nnnn.PIL) for each frame to be displayed.  In the text file type an exact 
  628. copy of the frame display screen.  In naming your frame files, choose names 
  629. which aid in the identification of the associated frames.  After you have 
  630. created the text file, insert PILOT's (T:) command to type the text to the 
  631. screen.  Most machine frames will have an area designated as the command line 
  632. where the blinking cursor is located awaiting response.  This can be 
  633. accomplished using the (TS:gx,y) command.  Use the ACCEPT (A:) command to 
  634. wait for a response to be evaluated.  
  635.  
  636. Determine the machine commands that cause one frame to link to other frames.  
  637. In some cases, an INDEX key on the console may have to be simulated by use of 
  638. the ALT key.  Some frames may not link to other frames directly, yet have to 
  639. go to a menu or index frame first.  Using PILOT's SYSX routine may be of 
  640. benefit here.  In either case, MATCH statements or use of the function keys 
  641. should direct the program to a LINK command (L:) that links the frame to 
  642. another.  Once this is accomplished for one frame, much of the same code can 
  643. placed in the other frame files.  
  644.  
  645. Determine the frame variables for each frame.  Frame text that is changed or 
  646. effected by commands should be identified.  Once identified, you must create 
  647. a variable name that represents that text item.  Use caution in selecting 
  648. variable names.  Try to chose a name that can be easily associated with the 
  649. text or function simulated.  Remember you must first dimension a string 
  650. variable before using it.  The variable length is set when you Dimension (D:) 
  651. the variable.  Next replace the text items with the appropriate variable 
  652. names using ($var$) within the frame text.  Once the initial value of the 
  653. variables is set in your entry module, you can change them using the COMPUTE 
  654. (C:) command.  
  655.  
  656. Determine other machine commands that require simulation.  First, ensure you 
  657. have a list of the commands to be simulated or acted upon from the command 
  658. line.  Then create MATCH (M:) statements for each of the possible commands.  
  659. Next determine what all should happen if a MATCH would occur.  Frame 
  660. variables can be changed by using the Compute on condition Yes statement 
  661. (CY:). Other variables may change depending on contents of other variables.  
  662. For example, you may need a way to change a variable only if it's content had 
  663. a particular string value. CY(var1$="content"):var$="new content" 
  664.  
  665. Determine error messages, not simulated commands and simulator messages to be 
  666. used.  Although the goal is to provide a real as possible environment, it may 
  667. not be practical to simulate every possible command or response.  In those 
  668. cases, the author may want to provide error handling routines that provide a 
  669. " Message from the Simulator" to be displayed on a predetermined area of the 
  670. screen.  For example, a message might be "Message from Simulator -- Command 
  671. not known or not simulated "  or "Simulated at greater than normal speed." 
  672.  
  673. Test the simulator next to the real machine.  This will allow you to see many 
  674. things that you may not have noticed before.  Next, ensure your entry modules 
  675. are task oriented.  You can provide a workbook that directs the student to 
  676. try certain tasks and asks them what has changed or taken place.  
  677.  
  678. Sample Machine Simulator Program  
  679.  
  680. The SAMPLE12.PIL, and SAMPLE13.PIL files contains an example of a machine 
  681. simulator that presents an Operator control frame similar to those on many 
  682. IBM systems. Try it to see a section of a simulator in action.  
  683.  
  684.  
  685. Appendix F. CALLING EXTERNAL PROGRAMS
  686.  
  687. Using the EXEC facility, a PILOT program can execute another program or DOS 
  688. command. EXEC permits the program to execute any command line, as if it were 
  689. entered to the DOS command line prompt. The command could perform DOS 
  690. functions such as DIR or COPY. It could as easily execute a program written 
  691. in BASIC or PASCAL, or execute another program product such as a word 
  692. processor or spread sheet. The called program need not be written in any 
  693. special manner, it is executed in an environment which is the same as if it 
  694. were executed via a DOS command line. When the called program terminates, 
  695. control is returned to the PILOT program which resumes execution at the next 
  696. statement. 
  697.  
  698. To use the EXEC facility the file EXEC.BIN must be present. The GETFILE.PIM 
  699. macro must be used to load and initialize the EXEC.BIN file. Once this is 
  700. done any number of calls to EXEC may be performed via the V: statement. 
  701.  
  702. To use EXEC in a program follow these steps:
  703.  
  704.      Use the EZ editor to expand the GETFILE.PIM macro 
  705.      in the initial portion of the PILOT program.
  706.      GETFILE.PIM prompts for a file name, enter the name
  707.      EXEC.BIN. It also prompts for a string name, use
  708.      the name EXEC$.  
  709.  
  710.      At any point within the PILOT program use the following
  711.      statements to call an external program:
  712.  
  713.           C:EXEC$(9,80) = "any DOS command line here"
  714.           V:EXEC$
  715.  
  716. The string passed to EXEC$ may be any command line, exactly as it would be 
  717. typed to the DOS command prompt "A>". For example, the following lines 
  718. perform a directory command. 
  719.  
  720.      C:EXEC$(9,80) = "DIR"
  721.      V:EXEC$
  722.  
  723. The following lines call a BASIC program named "HELLO". 
  724.  
  725.      C:EXEC$(9,80) = "BASIC HELLO"
  726.      V:EXEC$
  727.  
  728. If the command does not execute as expected, then upon return from the V: 
  729. statement, the following line would display an error code per the DOS Error 
  730. Return Table found in a DOS manual appendix. 
  731.  
  732.      T:Return code is #(ASC(EXEC$(3)))
  733.  
  734. As an additional return, EXEC$ returns the drive letter in which the file 
  735. COMMAND.COM was found in string position EXEC$(4). This information might be 
  736. useful in determining whether a program is executing from floppy or fixed 
  737. disk. 
  738.  
  739.  
  740. Appendix G. SUPPLEMENTAL MATERIALS
  741.  
  742. This section describes various other printed and program materials that may 
  743. be useful in PILOT program authoring.  
  744.  
  745. ADCIS
  746.  
  747. The "Association for the Development of Computer-Based Instructional Systems" 
  748. has a PILOT Language Special Interest Group. This association holds annual 
  749. meetings and publishes newsletters and the "Journal of Computer-Based 
  750. Instruction". ADCIS national offices can be reached at (206) 676-2860. 
  751.  
  752. WCS
  753.  
  754. Washington Computer Services, the developer of PILOT, publishes several 
  755. products and services for PILOT users: 
  756.  
  757. UPDATE SERVICE - New releases of PILOT are supplied. 
  758.  
  759. ADVANCED FEATURE LIBRARY - A package of utilities, special device drivers and 
  760. useful subroutines to increase productivity for the PILOT programmer.  
  761.  
  762. LEARNPI and DESIGNER - A 3-diskette tutorial set, LEARNPI, written in PILOT 
  763. on PILOT written by George Gerhold and Robert Urso. It covers basic 
  764. programming and screen design topics.  
  765.  
  766. VIDEO SCRIPT EXECUTIVE - VSX is an authoring environment for presentations 
  767. and lessons which may include video, text, graphics, mouse, touch screen and 
  768. video. VSX can reduce program development time by isolating the author from 
  769. programming details. The user can extend the power of VSX by coding in PILOT 
  770. as necessary.  
  771.  
  772. For complete information contact Washington Computer Services directly. 
  773. Phone: (206) 734-8248.  
  774.  
  775. SRA
  776.  
  777. SRA publishes beginner's level self-study course (book and diskette) entitled 
  778. "Developing Computer-Based Training with PC/PILOT" by Kirk Richardson and 
  779. Valerie Mock. 
  780.  
  781. ASYS
  782.  
  783. ASYS publishes PROPI a complete authoring system which can be used with the 
  784. PILOT language to provide a comprehensive large-scale authoring environment. 
  785. ASYS phone:  (206) 734-2553.  
  786.  
  787.